package sample.actor.path;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;

/**
 * @author liuyi
 * @date 2017/02/28 15:35
 */
public class Main {
    public static void main(String[] args) {
        ActorSystem mySystem1 = ActorSystem.create("mySystem1");
        ActorRef actor1 = mySystem1.actorOf(Props.create(EchoActor.class),"echoActor2");
//        ActorRef actor1 = mySystem1.actorOf(Props.create(EchoActor.class));
        System.out.println(actor1.path());

        ActorSystem mySystem2 = ActorSystem.create("mySystem2");
        ActorRef actor2 = mySystem2.actorOf(Props.create(EchoActor2.class),"echoActor2");
        System.out.println(actor2.path());

//        ActorSelection actor21 = mySystem1.actorSelection(actor2.path());
//        System.out.println(actor21.anchor().path());
//        System.out.println(actor21.anchorPath().toString());
//        akkapath.EchoActor echoActor = new akkapath.EchoActor();
//        System.out.println(echoActor);
    }
}
